from enum import Enum

from pydantic import BaseModel


class Account(BaseModel):
    username: str
    password: str
    qrcode_key: str | None = None


class TimeEnum(Enum):
    five_minute = "5_minute"
    hour = "hour"
    day = "day"


class Attention(BaseModel):
    uid: str
    bvid: str | None = None
    mid: str | None = None


class RedisPut(BaseModel):
    key: str
    value: str


class TrendingPageParams:
    def __init__(self, ps: int = 50, pn: int = 0, mode: TimeEnum = TimeEnum.five_minute):
        self.ps = ps
        self.pn = pn
        self.mode = mode


fmt = {
    "5_minute": "%Y-%m-%d %H:%i:%s",
    "hour": "%Y-%m-%d %H:00:00",
    "day": "%Y-%m-%d"
}
